<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>		
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css">
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.js">
	</script>
<title>八维贴吧</title>
</head>
<body>
  <!-- 包含header.jsp -->
  <jsp:include page="/WEB-INF/view/common/header.jsp"/>
  
  <!-- ///////////////////////////////自己开发部分中间部分开始/////////////////////////// -->
  <form style="display: none;" id="pageFrm" action="${pageContext.request.contextPath}/users" method="post">
     <input type="text" id="pageNum" value="${pageInfo.pageNum}" name="pageNum"/>
  </form>
  <div class="container">
        <div class="row">
            <div class="col12">
                    <div class="card" style="background-color: white">
                        <div class="card-header">
                            <b>最新用户</b>
                        </div>
                        <div class="card-body">
                            <table>
                                <thead>
                                    <tr>
                                        <th>昵称</th>
                                        <th>性别</th>
                                        <th>生日</th>
                                        <th>年龄</th>
                                        <th>发贴数</th>
                                        <th>注册时间</th>
                                  
                                    </tr>
                                </thead>
                                
                                    <tbody>
                                    <c:forEach var="user" items="${pageInfo.list}">
                                    <tr>
                                        <td>${user.nickName }</a></td>
                                        <td align="center">${user.gender.displayName}</td>
                                        <td align="center">
                                        <fmt:formatDate value="${user.birthday}" pattern="yyyy-MM-dd"/>
                                        </td>
                                         <td align="center">${user.age}</td>
                                        <td align="center">${user.topicNum }</td>
                                        <td align="center"><fmt:formatDate value="${user.created}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                    </tr>
                                
                                </c:forEach>
                                
                            </tbody></table>
                            
                            <!-- 分页代码包含部分，注意page_num.jsp中的变量名称为pageInfo -->
                            <p align="center">
                               <jsp:include page="/WEB-INF/view/page/page_num.jsp"/>
                            </p>
                        </div>
                    </div>
            </div>
        </div>
    </div>
  
  
  
  
  <!-- ///////////////////////////////自己开发部分中间部分开始/////////////////////////// -->
  
  <!-- jsp包含尾部footer.jsp -->
  <jsp:include page="/WEB-INF/view/common/footer.jsp"/>
  
  <script type="text/javascript">
    function searchData(pageNum){
        $("#pageNum").val(pageNum);
        $("#pageFrm").submit();
     }

  </script>
  
</body>
</html>